package com.douyin.utils;

import java.util.concurrent.ThreadLocalRandom;

public class VerificationCodeGenerator {
    public static String generateCodeV2() {
        // 获取当前线程的随机数生成器
        ThreadLocalRandom random = ThreadLocalRandom.current();

        StringBuilder code = new StringBuilder();
        for (int i = 0; i < 6; i++) {
            // 生成一个 [0, 10) 之间的整数，即 0-9
            code.append(random.nextInt(10));
        }
        return code.toString();
    }

}
